import Mock from 'mockjs';

Mock.setup({ timeout: '200-600' });

// var Random = Mock.Random();

import treeJson from '../../public/data/scenes/treeData.json';
import formJson from '../../public/data/test/formData.json'

function scenesData(params) {
    const prarmsObj = JSON.parse(params.body);
    let scenesRes;
    switch (prarmsObj.sceneId) {
        case 'sceneA':
            scenesRes = { code: 1, text: '查询场景A成功' };
            break;
        default:
            scenesRes = { code: 0, text: 'error query' }
    }
    return scenesRes;
};

function treeData() {
    return treeJson
}

function formData() {
    return formJson
}


Mock.mock('/scenes', 'post', scenesData)

Mock.mock('/treeData', 'get', treeData)

Mock.mock('/formData', 'get', formData)